import React  from 'react';
import {List} from 'weaver-mobile';
import { Form } from 'weaver-mobile-page';
import { asyncComponent } from 'react-async-component';
import { NoticeBar,Icon  } from 'weaver-mobile';
import HOCcomponent from '../hocComponent';

const coms = {
  ComForm: asyncComponent({
    resolve: () => import("../../governTools/comForm/comForm")
  })
}
/*
 * @info: 任务内容组件
 * @Author: lusx
 * @Date: 2019-12-01 11:13:16
 * @Last Modified by: lusx
 * @Last Modified time: 2019-10-30 16:27:33
 */
class ContentPage extends React.Component {
  render() {
    const {form,isCommentRight,isRight,touchStart,handleTouchEnd} = this.props;
    return(
      <div className="g-contentPage" style={{height:'100%'}} isright={isRight} iscommentright={isCommentRight}>
        <div
          onContextMenu={this.handleRightClick}
          onTouchStart={touchStart}
          onTouchEnd={handleTouchEnd}>
            <NoticeBar mode="link" icon={null}  action={<span style={{ color: '#a1a1a1' }}>不再提示</span>} onClick={this.hideBar}>
                长按该页面进行更多操作
            </NoticeBar>
            <Form style={{ height: '100%' }} >
              <List>
                <coms.ComForm comForm={form} />
              </List>
            </Form>
        </div>
        
      </div>
    );
  }
  hideBar =()=>{
    document.getElementsByClassName("am-notice-bar")[0].style.display= 'none';
  }
  handleRightClick = (e)=>{
    e.persist();
    e.preventDefault();
    return false;
    // e.stopPropagation();
    // e.preventDefault();
  }
}
export default HOCcomponent(ContentPage);
